(function ($) {
  $(".list .item").click(function () {
    $(".list .item").each(() => {
      $(".list .item").removeClass("active");
    });
    $(this).addClass("active");
  });
  $(".submit-box").click(function () {
    let userName = $(".userName").val();
    let tel = $(".tel").val();
    let msg = $(".msg").val();
    if (userName === "") {
      spop({
        template: "请填写姓名",
        group: "submit-satus",
        style: "warning",
        position: "top-right",
        autoclose: 1000,
      });
      return false;
    }
    if (tel === "") {
      spop({
        template: "请填写电话号码",
        group: "submit-satus",
        style: "warning",
        position: "top-right",
        autoclose: 1000,
      });
      return false;
    }
    if (msg === " ") {
      spop({
        template: "请填写投诉内容",
        group: "submit-satus",
        style: "warning",
        position: "top-right",
        autoclose: 1000,
      });
      return false;
    }
    spop({
      template: "您的投诉已提交",
      group: "submit-satus",
      style: "success",
      position: "top-right",
      autoclose: 2000,
    });
  });
})(jQuery);
